package com.shu.logsearch.core.controller;

import com.shu.logsearch.jsch.model.RemoteServerConfig;
import com.shu.logsearch.jsch.service.RemoteServerConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author Tree Cai
 * @date 2019/7/10
 */
@Controller
@RequestMapping("/admin/view")
public class AdminViewController {

    @Autowired
    RemoteServerConfigService remoteServerConfigService;

    @RequestMapping("/index")
    public String index() {
        RemoteServerConfig remoteServerConfig = new RemoteServerConfig();
        remoteServerConfig.setId("1");
        remoteServerConfig.setPassword("123123");
        remoteServerConfigService.save(remoteServerConfig);
        return "admin/index";
    }

}
